package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface UserMapper {
    void insertUser(User user);

    @Select("select * from user where openid =#{openid}")
    User getUserByOpenId(String openId);

    List<User> getAllUsers(LocalDateTime begin, LocalDateTime end);

    @Select("SELECT COUNT(*) FROM user WHERE DATE(create_time) = CURDATE()")
    Integer getNewUserCount();
}
